package com.geek.hotupdate.config;

import com.geek.hotupdate.beans.Updater;
import com.geek.hotupdate.config.source.ConfigSource;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
public class KafkaConfig implements Updater {
    @Autowired
    private ConfigSource configSource; //配置中心（比如zookeeper）
    private String address;
    private int timeout;
    private int maxTotal;
    //省略其他配置: maxWaitMillis,maxIdle,minIdle...

    public String getAddress() {
        return this.address;
    }
    //...省略其他get()、init()方法...

    @Override
    public void update() {
        //从configSource加载配置到address/timeout/maxTotal...
    }
}